From: Rui Matos Date: Sun, 20 Aug 2017 15:52:48 +0000 (+0200) Subject: network: Simplify and fix VPN settings menu item X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~123 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f2a9467f91b2d34c5b8d7a653ff14562e2210015;p=gnome-shell.git network: Simplify and fix VPN settings menu item As in commit b2b2f65 and furthermore it doesn't make much sense to change the menu item according to the number of connections since all connections here are of the same type. https://bugzilla.gnome.org/show_bug.cgi?id=786520 --- diff --git a/js/ui/status/network.js b/js/ui/status/network.js index 831027e1a..02a43c10d 100644 --- a/js/ui/status/network.js +++ b/js/ui/status/network.js @@ -1491,36 +1491,7 @@ var NMVPNSection = new Lang.Class({ _init: function(client) { this.parent(client); - this._vpnSettings = new PopupMenu.PopupMenuItem(''); - this.item.menu.addMenuItem(this._vpnSettings); - this._vpnSettings.connect('activate', Lang.bind(this, this._onSettingsActivate)); - - this._sync(); - }, - - _sync: function() { - let nItems = this._connectionItems.size; - this.item.actor.visible = (nItems > 0); - - if (nItems > 1) - this._vpnSettings.label.text = _("Network Settings"); - else - this._vpnSettings.label.text = _("VPN Settings"); - - this.parent(); - }, - - _onSettingsActivate: function() { - let nItems = this._connectionItems.size; - if (nItems > 1) { - let appSys = Shell.AppSystem.get_default(); - let app = appSys.lookup_app('gnome-network-panel.desktop'); - app.launch(0, -1, false); - } else { - let connection = this._connections[0]; - Util.spawnApp(['gnome-control-center', 'network', 'show-device', - connection.get_path()]); - } + this.item.menu.addSettingsAction(_("VPN Settings"), 'gnome-network-panel.desktop'); }, _getDescription: function() {